package com.design.pattern.component.generation;

public class Setting {
    public static void main(String[] args) {
        Man root=new Man("族谱",0);
        //一代始祖
        Man zhangYi=new Man("张一",1);
        root.add(zhangYi,"始祖");
        //始祖妻子
        Genealogy wangYi=new Female("王一",1);
        zhangYi.add(wangYi,"妻子");
        //始祖女儿
        Female zhangYin=new Female("张颖",2);
        zhangYi.add(zhangYin,"女儿");
        //始祖儿子
        Man zhangEr=new Man("张二",2);
        zhangYi.add(zhangEr,"儿子");
        //始祖儿子
        Man zhangErEr=new Man("张二二",2);
        zhangYi.add(zhangErEr,"儿子");
        //张二妻子
        Female liuLi=new Female("刘丽",2);
        zhangEr.add(liuLi,"妻子");
        //张二儿子
        Man zhangSan=new Man("张三",3);
        zhangEr.add(zhangSan,"儿子");
        //张三儿子
        Man zhangSi=new Man("张四",4);
        zhangSan.add(zhangSi,"儿子");
        System.out.println(root.show());
    }
}
